import request from '@/utils/request'

// 获取所有单词列表
export const wordListService = () => request.get('/word/list')

// 获取没有背诵的单词列表
export const wordGetWriteService = (obj) => request.post('/word/wirte', obj)

// 修改背诵的单词状态
export const wordUpdateWriteStatusService = (userId, wordId) =>
  request.get('/word/update', {
    params: {
      userId,
      wordId
    }
  })

// 移除已经背过的单词
export const wordRemoveWriteStatusService = (userId, wordId) =>
  request.get('/word/remove', {
    params: {
      userId,
      wordId
    }
  })

// 获取 已经背过的单词
export const getWriteWordListService = (userId) =>
  request.get('word/findWriteAll/' + userId)

// 清空所有单词
export const cleanWriteWordsService = (userId, code) => {
  return request.post('/word/clean', {
    id: userId,
    code
  })
}
